43a9cbf0a9c7e7010c624b13224090728b4d7ae1,src/main/java/org/crosswire/jsword/book/sword/DataEntry.java,DataEntry,getKey,#,81

Before Change



            // The key may have whitespace, including \r on the end,
            // that is not actually part of the key.
            key = SwordUtil.decode(name, data, keyEnd, charset).trim();

            // for some weird reason plain text dictionaries
            // all get \ added to the ends of the index entries.

After Change


    public String getKey() {
        if (key == null) {
            // Some entries are empty
            if (data.length == 0) {
                key = "";
                return key;
            }

            if (keyEnd < 0) {
                key = "";
                return key;
            }

            int end = keyEnd;
            // remove trailing \r if present
            if (end > 0 && data[end - 1] == SEP_CR) {
                --end;
            }

            // for some weird reason plain text dictionaries
            // all get \ added to the ends of the index entries.
            if (end > 0 && data[end - 1] == SEP_BSLASH) {
                --end;
            }

            // If the end is 0 then we have an empty key.
            if (end == 0) {
                key = "";
                return key;
            }

            // The key may have whitespace, including \r on the end,
            // that is not actually part of the key.
            key = SwordUtil.decode(name, data, end, charset);
        }

        return key;